package com.excilys.formation.project.services.impl;

import java.util.SortedSet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.excilys.formation.project.entities.Compte;
import com.excilys.formation.project.repository.CompteDAO;
import com.excilys.formation.project.services.CompteService;

/**
 * 
 * @author excilys
 * 
 */
@Service("compteService")
@Transactional(readOnly = true)
public class CompteServiceImpl implements CompteService {

	/**
	 * Instance du CompteDAO pour le service.
	 */
	@Autowired
	private CompteDAO compteDAO;

	@Override
	public Compte getCompte(final String numero) {
		return compteDAO.getCompte(numero);
	}

	@Override
	public SortedSet<Compte> getComptesByClient(long clientId) {
		return compteDAO.getComptesByClient(clientId);
	}
}
